package com.clps.algorithm.chapter02.排序数组中两个数字之和;


public class demo01 {

    public static void main(String[] args) {

    }


    public  int[] twoSum (int[] numbers,int target){
        int i = 0;
        int j = numbers.length -1;
        while (i<j &&numbers[i] + numbers[j]!=target){
            if(numbers[i] + numbers[j] < target){
                i++;
            }else{
                j--;
            }
        }
        return  new int[]{i,j};
    }
}
